HTTP-SCRAPE
A brief description of your crate, explaining what it does and its main features.
Table of Contents
Features
- HTTP/2 & HTTP/3 Support: Extending the parser for modern HTTP protocols.
- Asynchronous Parsing | Syncronous Parsing: Non-blocking parsing for better performance.
- Header Parsing: Extract individual headers for enhanced request handling
Installation
To include this crate in your project, add the following line to your Cargo.toml
:
[]
= "0.1.1127"
Response;
{
= Response::new("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nHello World");
// Parse the HTTP method
= response.method();
"Method: {}", method); // Output: GET | POST | DELETE | PUT | OPTIONS
// Extract the path
= response.path();
"Path: {}", path); // Output: The requested URL path
// Get cookies (if any)
= response.cookie();
"Cookie: {:?}", cookie); // Output: Cookies if available
// Retrieve content from the HTTP body
= response.content();
"Content: {}", content); // Output: HTTP body content
}